Repository navigation
[BREAKINGCHANGE] Add support for React 19+ - #889
Conversation
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Nexucis
left a comment
There was a problem hiding this comment.
Together with perses/shared#390, the use-resize-observer v10 migration and the wider react/react-dom ranges look good.
One thing still prevents plugins from running on a React 19 host. The lockfile still builds plugins with React 18.3.1, and plugins share only react and react-dom, so every bundle includes React 18's react/jsx-runtime. On a React 19 host, that runtime gets the shared React 19 as react and crashes as soon as it loads:
Cannot read properties of undefined (reading 'ReactCurrentOwner')
I reproduced this with React 18.3.1's production runtime against React 19. Until it's fixed, the READMEs' "requires react and react-dom 18 or 19" doesn't hold at runtime. The host-side change is suggested in perses/shared#390.
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Bump @perses-dev/{client,components,dashboards,explore,plugin-system} to
^0.56.0-beta.0 and apply the breaking changes from perses/shared#390 and
perses/shared#391:
- Share react/jsx-runtime as a singleton in every plugin's Module
Federation config so plugins use the host's JSX runtime on React 19.
- Upgrade @tanstack/react-table to ^9.2.8 in the table and flamechart
plugins to match @perses-dev/components, and use concrete row types
instead of `unknown` for TableColumnConfig.
- Use CellContext<TableFeatures, ...> in the piechart legend test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Nexucis
left a comment
There was a problem hiding this comment.
Thanks for this! Overall it looks good:
- The Module Federation contract matches the host after perses/shared#390 (
react/jsx-runtimeanduse-resize-observer@10are both shared by the host). react-compiler-runtimedelegates to React 19's built-in__COMPILER_RUNTIME.c, so keeping the compiler target at18is fine.- There are no leftover React 19 breakers (
JSX.Element,defaultProps,react-dom/test-utils,useRef()without an argument). - The new
react-19job really runs on React 19 (npm install --no-saveupdated 48 packages, and type-check and tests pass). - The stateful wrappers in the gauge and histogram editor tests make sense for controlled editors.
A few points, with details inline:
- Dev mode on a React 19 host:
rsbuild devemitsreact/jsx-dev-runtime, which isn't shared, so each plugin bundles React 18's dev runtime. - Compatibility with older hosts: this effectively requires Perses >= 0.56. Consider
[BREAKINGCHANGE]in the title and holding releases until shared 0.56 is stable rather than beta. - Nits:
json/README.mdis outdated, and the React 19 CI job could assert the React version it installed.
- Compile plugin JSX with the production `react/jsx-runtime` even in dev mode, so dev builds consume the host's shared JSX runtime instead of bundling React 18's `react/jsx-dev-runtime` (broken on a React 19 host). - Align the json plugin's README and react/react-dom peer range with the other plugins (React 18 or 19). - Assert the React 19 CI job actually installed React 19. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Align the react, react/jsx-runtime and react-dom requiredVersion ranges with the ^18.3.0 || ^19.0.0 peer dependency range. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Nexucis
left a comment
There was a problem hiding this comment.
Thanks for addressing the previous comments!
I checked the latest changes locally:
- Dev mode: a development build of barchart now only imports the shared
react/jsx-runtime(nojsxDEV). Fast Refresh still works, because@rsbuild/plugin-reactsetsrefreshindependently ofdevelopment. - Version ranges: the Module Federation runtime accepts
^18.3.0 || ^19.0.0(18.3.x and 19.x pass; 18.2, 17 and 20 don't). - Host contract:
@perses-dev/plugin-system@0.56.0-beta.0sharesreact/jsx-runtimeanduse-resize-observerv10, which matches the plugins' shared config. - Checks:
npm run type-check,npm run lint,npm run format:root:checkandnpm run testpass on React 18, and CI is green, including the React 19 job.
Required: please change the PR title and the merged commit to [BREAKINGCHANGE] Add support for React 19+. These plugins no longer load on a Perses 0.55 host (details inline).
Nit (outside the diff): the snapshot example in the root README.md still shows react/react-dom ^17.0.2 || ^18.0.0 and use-resize-observer ^9.0.0.
Follow-up for perses/perses: the plugin generator templates (internal/cli/cmd/plugin/generate/templates/module/) need the same changes: React range, react/jsx-runtime sharing, swcReactOptions, and use-resize-observer v10. In particular, vitest.config.ts.tmpl aliases use-resize-observer/polyfilled, which no longer exists in v10.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
perses/shared#390 and perses/plugins#889 merged on 2026-10-28 and ship in 0.56.0-beta.0, so the router setting's exit is React 19 with Perses 0.56 or later. The notes said the support was still open. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
… support Perses supports React 19 from 0.56 (perses/shared#390 and perses/plugins#889, merged 2026-10-28); 0.56.0-beta.0 and a beta of each plugin the console bundles are the first releases with it. They are pinned exactly: @perses-dev/client, components, dashboards and plugin-system 0.56.0-beta.0, gauge 0.15.0-beta.0, loki 0.8.0-beta.0, markdown 0.14.0-beta.0, pie 0.16.0-beta.0, prometheus 0.60.0-beta.0, stat 0.16.0-beta.0, table 0.15.0-beta.0 and timeseries 0.15.0-beta.0. They are newer than pnpm's minimum release age, so pnpm-workspace.yaml excludes them from it until 0.56.0 is released. The peers only Perses needs move with it: @hookform/resolvers 3.9.1 -> 5.9.2 (the plugins want ^5.9.1), use-resize-observer 9.1.0 -> 10.0.0 (9 declares React up to 18) and @perses-dev/spec 0.2.0 -> 0.3.0. pnpm now reports no peer dependency issues. Perses's own zod is now zod 4, the console's copy. - The pie chart patch goes: 0.16.0-beta.0 imports `format` from 'echarts/core' itself (perses/plugins#893). The Dockerfile no longer copies the patches folder. - buildProxyUrl takes Perses's BuildDatasourceProxyUrlParams, whose name is optional in 0.56: without one, Perses asks for its unsaved-datasource proxy (testing a datasource before saving it), which the relay doesn't serve, so it throws like a dashboard's own datasource does. - Vitest inlines @perses-dev/*: 0.56 is "type": "module" and imports mdi-material-ui/<Icon> without an extension, which Node's ES module resolver refuses. - The dev server aliases those imports to mdi-material-ui/esm/<Icon>. The icons are CommonJS files and mdi-material-ui has no "exports" map; esbuild's dependency pre-bundling follows Node's rules for an ES module importing CommonJS, so the default import is the whole module.exports and the Monitoring page fails to render ("Element type is invalid"). The production build (Rollup) honours __esModule and doesn't need it. Perses 0.56 still declares Query v4, so the override stays, and so do the v4 names docs/connect.md lists. The Monitoring chunk grows from about 1,024 kB to 1,178 kB gzipped; a later commit looks into why. Signed-off-by: Juntao Wang <juntwang@redhat.com>
Description
Depends on PR: perses/shared#390.
Add support for React 19+, while still keeping React 18 as base.
Related to perses/perses#4578
Done by IA (Opus 5.5)
Breaking change
Plugins will only load on Perses >= 0.56.0.beta.0
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes